﻿using DAL;
using Models;

namespace BLL
{
    public class UserInfoBLL
    {
        //修改
        public static bool updateByIDBLL(UserInfo user)
        {
            return UserInfoDAL.updateByIDDAL(user);
        }
        //根据账号、手机号进行查询
        public static bool loginBLL(string count, string password)
        {
            UserInfo user = UserInfoDAL.loginDAL(count);
            if (user == null)
            {
                return false;
            }
            return user.UserPwd == password;
        }
        //根据账号进行查询
        public static UserInfo getAllByUsername(string username)
        {
            return UserInfoDAL.loginDAL(username);
        }
        //获取用户状态
        public static string getStateBLL(string count)
        {
            return UserInfoDAL.getStateDAL(count);
        }
        //根据Username进行查询
        public static bool selectByNameBLL(string username)
        {
            return UserInfoDAL.selectByNameDAL(username);
        }
        //增加
        public static bool addUserBLL(string username,string password)
        {
            return UserInfoDAL.addUserDAL(username,password);
        }
    }
}
